/**
 * 
 */
package com.jie.eclipse.pan.form.item;

import com.jie.eclipse.pan.data.BaseDataEntity;
import com.jie.eclipse.pan.form.support.FormItem;

/**
 * @author yanjie
 *
 */
public class Table extends FormItem{
	/**
	 * 
	 */
	public Table() {
		this.setNodeName("jm:table");
	}
	
	@Override
	public void configItem(BaseDataEntity config,String action){
		if(config ==null)return;
		
		this.spsv("id", config.gpsv("id"));
		//数据源
		if(!config.isNullOrEmpty("dataSet")){
			if("default".equalsIgnoreCase(config.gpsv("dataSet"))){
				this.spsv("dataSet", "<%=ret.getSerchResult()%>");
			}else{
				this.spsv("dataSet", "<%=ret.gpov(\""+config.gpsv("dataSet")+"\")%>");
			}
		}else{
			this.RemoveExtValue("dataSet");
		}
		
		//空值循环一次
		if(config.gpbv("loopFisrt", false)){
			this.spsv("loopFisrt", "true");
		}else{
			this.RemoveExtValue("loopFisrt");
		}
		
		//锁表头
		if(!config.isNullOrEmpty("view") && "fixedRow".equals(config.gpsv("view"))){
			this.spsv("view", "fixedRow");
		}else{
			this.RemoveExtValue("view");
		}
		//表格工具栏
		if(config.gpbv("toolbar", false)){
			this.spsv("toolbar", "true");
		}else{
			this.RemoveExtValue("toolbar");
		}
	}
}
